import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const localCity = ref('') // 本地城市
  const cityAdcode = ref('') // 本地城市adcode
  const localLemplete = ref([]) //本地气温和天气 [白天气温,晚上气温,天气]

  const showLoading = ref(false) //导航组件是否显示
  const showPanelDriving = ref(false) //导航路线列表是否显示
  const showLogins = ref(false) // 是否显示登录页面
  const logined = ref(false) // 是否登录
  const changeLogined = () => {
    logined.value = !logined.value
  }
  const changeShowLoading = () => {
    showLoading.value = !showLoading.value
  }
  const changeShowPanelDriving = () => {
    showPanelDriving.value = !showPanelDriving.value
  }
  const changeShowPanelDrivingTrue = () => {
    showPanelDriving.value = true
  }
  const changeShowPanelDrivingFalse = () => {
    showPanelDriving.value = false
  }
  const changeShowLogins = () => {
    showLogins.value = !showLogins.value
  }
  return {
    localCity,
    cityAdcode,
    localLemplete,
    showLoading,
    showPanelDriving,
    showLogins,
    logined,
    changeLogined,
    changeShowLoading,
    changeShowPanelDriving,
    changeShowPanelDrivingTrue,
    changeShowPanelDrivingFalse,
    changeShowLogins,
  }
})
